package com.cm.sys.system.entity;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @ClassNameMenu
 * @Description
 * @Author WZC @Date2019/11/30 5:50
 * @Version V1.0
 **/
public class Menu implements Serializable{
	private static final long serialVersionUID = 1830211314943112574L;
	private Integer id; // 菜单id
    private Integer parentId; // 子级菜单id
    private Integer sortInt; // 排序
    private String parentName; // 菜单名
    private String route; // 路由
    private String icon; // 图标
    private Integer isShow; // 是否显示
    private Integer createTime; // 创建时间
    private Integer updateTime; // 修改时间
    private List<Menu> childrens;

    private Integer reviewStatus = 0;

    public Menu() {}

    public Menu(Integer id, Integer parentId, Integer sortInt, String parentName, String route, String icon,
        Integer isShow, Integer createTime, Integer updateTime, List<Menu> childrens) {
        this.id = id;
        this.parentId = parentId;
        this.sortInt = sortInt;
        this.parentName = parentName;
        this.route = route;
        this.icon = icon;
        this.isShow = isShow;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.childrens = childrens;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getSortInt() {
        return sortInt;
    }

    public void setSortInt(Integer sortInt) {
        this.sortInt = sortInt;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public String getRoute() {
        return route;
    }

    public void setRoute(String route) {
        this.route = route;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getIsShow() {
        return isShow;
    }

    public void setIsShow(Integer isShow) {
        this.isShow = isShow;
    }

    public Integer getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Integer createTime) {
        this.createTime = createTime;
    }

    public Integer getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Integer updateTime) {
        this.updateTime = updateTime;
    }

    public List<Menu> getChildrens() {
        return childrens;
    }

    public void setChildrens(List<Menu> childrens) {
        this.childrens = childrens;
    }

    public Integer getReviewStatus() {
        return reviewStatus;
    }

    public void setReviewStatus(Integer reviewStatus) {
        this.reviewStatus = reviewStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Menu)) {
            return false;
        }
        Menu menu = (Menu)o;
        return Objects.equals(id, menu.id) && Objects.equals(parentId, menu.parentId)
            && Objects.equals(sortInt, menu.sortInt) && Objects.equals(parentName, menu.parentName)
            && Objects.equals(route, menu.route) && Objects.equals(icon, menu.icon)
            && Objects.equals(isShow, menu.isShow) && Objects.equals(createTime, menu.createTime)
            && Objects.equals(updateTime, menu.updateTime) && Objects.equals(childrens, menu.childrens);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, parentId, sortInt, parentName, route, icon, isShow, createTime, updateTime, childrens);
    }

    @Override
    public String toString() {
        return "Menu{" + "id=" + id + ", parentId=" + parentId + ", sortInt=" + sortInt + ", parentName='" + parentName
            + '\'' + ", route='" + route + '\'' + ", icon='" + icon + '\'' + ", isShow=" + isShow + ", createTime="
            + createTime + ", updateTime=" + updateTime + ", childrens=" + childrens + '}';
    }
}
